package com.scy.java.Test.Test05;

import java.util.Scanner;

public class Test01 {
    public static void main(String[] args) {
        //键盘录入
        System.out.println("请输入字符串：");
        String sNext = new Scanner(System.in).next();
        //定义临时变量
        int bigCount = 0;
        int smallCount = 0;
        int numberCount = 0;
        //遍历
        for (int i = 0; i < sNext.length(); i++) {
            char c = sNext.charAt(i);
//            Character类方法对字符进行判断
            if ( Character.isUpperCase(c)){//isUpperCase(c) 判断该字符是否为大写字母字符
                bigCount++;
            }else if (Character.isLowerCase(c)){//isLowerCase(c) 判断该字符是否为小写字母字符
                smallCount++;
            }else if (Character.isDigit(c)){//isDigit(b) 判断该字符是否为数字字符
                numberCount++;
            }
        }
        System.out.println("大写字符有："+bigCount);
        System.out.println("小写字符有："+smallCount);
        System.out.println("数字字符有："+numberCount);

    }
}
